package com.hzspace.elasticsearch.repository;

import com.hzspace.elasticsearch.entity.Product;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
import org.springframework.stereotype.Component;

import java.util.List;


/**
 * TODO
 *
 * @Version 1.0
 * @Author hz
 * @Date 2020/11/28 16:06
 */
@Component
public interface ProductRepository extends ElasticsearchRepository<Product, Integer> {

    Page<Product> findByName(String name, Pageable pageable);
    Page<Product> findByNameLike(String name, Pageable pageable);
    List<Product> findByName(String name);

}
